import React from 'react';
import { BrowserRouter as Router, Redirect, Route, Switch } from 'react-router-dom';
import './index.scss';

const Layout = React.lazy(() => import('@/pages/Layout'));
const Login = React.lazy(() => import('@/pages/Login'));
export default function App() {
  return (
    <Router>
      <React.Suspense fallback={<div>...加载中...</div>}>
        <Switch>
          <Redirect from='/' to='/layout/userManager' exact />
          <Route path='/layout' component={Layout} />
          <Route path='/login' component={Login} />
        </Switch>
      </React.Suspense>
    </Router>
  );
}
